package com.design.observer;

/**
 * @author cxx
 * @create 2020-04-21 13:50
 **/
public class Main {

    /**
     * 观察者模式（订阅模式）
     * @param args
     */
    public static void main(String[] args) {

        Subject subject = new Subject ();
        new AliPay (subject);
        new WxPay (subject);
        new BankPay (subject);
        subject.setState (1);
        subject.setState (2);

    }



}
